import 'package:example/app/utils/string_utils.dart';
import 'package:flutter/material.dart';

import 'app_bar.dart';

class WebViewTitle extends StatelessWidget {

  final String title;
  final Future<bool> future;

  const WebViewTitle({Key? key, required this.title, required this.future}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      children: <Widget>[
        FutureBuilder<bool>(
          future: future,
          initialData: false,
          builder: (context, snapshot) => snapshot.data == true
              ? SizedBox.shrink()
              : Padding(
              padding: EdgeInsets.only(right: 5), child: AppBarIndicator()),
        ),
        Expanded(
            child: Text(
              //移除html标签
              StringUtils.removeHtmlLabel(title)??"",
              overflow: TextOverflow.ellipsis,
              style: TextStyle(fontSize: 16),
            ))
      ],
    );
  }
}
